home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / csim / source.lha / source / C++SIM / Examples / Queue.h < prev    next >
C/C++ Source or Header  |  1993-06-14  |  563b  |  47 lines

  1. /*
  2.  * Copyright (C) 1993
  3.  *
  4.  * Department of Computing Science,
  5.  * The University,
  6.  * Newcastle upon Tyne,
  7.  * UK.
  8.  */
  9.  
  10. #ifndef QUEUE_H_
  11. #define QUEUE_H_
  12.  
  13. #ifndef PROCESS_H_
  14. #include <Process.h>
  15. #endif
  16.  
  17. #ifndef JOB_H_
  18. #include "Job.h"
  19. #endif
  20.  
  21.  
  22. /* This is the queue on which Jobs are placed before they are used. */
  23.  
  24. struct List
  25. {
  26.     Job* work;
  27.     List* next;
  28. };
  29.  
  30. class Queue
  31. {
  32. public:
  33.     Queue ();
  34.     ~Queue ();
  35.  
  36.     boolean IsEmpty ();
  37.     long QueueSize ();
  38.     Job *Dequeue ();
  39.     void Enqueue (Job*);
  40.  
  41. private:
  42.     List* head;
  43.     long length;
  44. };
  45.  
  46. #endif
  47.